php forum
php mysql forum
php mysql smarty
 
Topic Options
#318156 - 08/23/09 06:39 PM [7.x] UBB.Nag Screens
Gizmo Online   shocked

Wizard

Registered: 01/10/00
Posts: 5287
Loc: Portland, OR, USA
Author: Gizmo (James of VNC Web Design & Development

Requirements: UBB.Threads 7.x (not compatible with UBB.Threads 6.x or below)

About:
This modification will allow you to add "signup nag screens" to your forums; these will show for any indicated groups (through the "Site Permissions" screen.

We use a Custom Island for the nag screen, you'll need to configure one to your liking.

Demo:
You can see a working demo on UGN Security.

Install Instructions:
Add The New Permission
Using PHPMyAdmin or the UBB.T7 Database Tools Page, execute the following (adds the new permission to the db, be sure to change ubbt_ to your db prefix):
Code:
ALTER TABLE `ubbt_SITE_PERMISSIONS` ADD `SHOW_NAG` TINYINT( 4 ) NOT NULL DEFAULT '0';


And (adds the new permission to the permission group, be sure to change "yourdb" to your database name and "ubbt_" to your db prefix):
Code:
INSERT INTO `yourdb`.`ubbt_PERMISSION_LIST` (`PERMISSION_NAME`, `PERMISSION_IS_HIGH` , `PERMISSION_IS_LOW` , `PERMISSION_TYPE`, `PERMISSION_ORDER`) VALUES ('SHOW_NAG', '1', '0', 'site', '8');


Now, edit the language file "admin/siteperms.php" and add the following (gives the new permission a name for the editing screens):
$ubbt_lang['SHOW_NAG'] = "Must View Nag Screens";

Now, go to the Site Permissions link in the control panel, and add what groups should be forced to view the nag (example, guests).


Create a Custom Island
Go to the CP and create a new Custom Island, you'll need the "External Use" code for this island for our next step. This island will contain all of the data for the nag screen. You can get the external use code for the Custom Island from the Portal Layout screen.

For our example, mine is:
Code:
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo "<table width=\"100%\">";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
echo "</table>";
?>


Please note that ALL we need here are the include lines; you'll use these in place of mine in the below steps.


Add The Content
Files modified:
scripts/activetopics.inc.php
scripts/cfrm.inc.php
scripts/postlist.inc.php
scripts/showflat.inc.php
templates/default/activetopics.tpl
templates/default/cfrm.tpl
templates/default/cfrm_cat_only.tpl
templates/default/postlist.tpl
templates/default/showflat.tpl


In scripts/activetopics.inc.php Find:
Code:
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars


Add After:
Code:
	if($userob->check_access("site","SHOW_NAG")) {
		$nag = 1;
	}


Find:
Code:
		"u_link" => $u_link


Add AFTER:
Code:
,
		'nag' => & $nag,



In templates/default/activetopics.tpl Find:
Code:
{* Script Version 7.5.3 *}


Add After:
Code:
{if $nag eq '1'}
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";
$tbopen="<table width=\"100%\" class=\"t_outer\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td>\n<table width=\"100%\" class=\"t_inner\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>";
$tbclose="</thead>\n</table>\n</td>\n</tr>\n</table>";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
{/php}
{/if}



In scripts/cfrm.inc.php (this is for the main index) Find:
Code:
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars


Add After:
Code:
	if($userob->check_access("site","SHOW_NAG")) {
		$nag = 1;
	}


Find:
Code:
		'catrow' => & $catrow,


Add After:
Code:
		'nag' => & $nag,



In templates/default/cfrm.tpl Find:
Code:
{if $introtitle}
{$tbopen}
<tr>
<td class="tdheader">{$introtitle}</td>
</tr>
<tr>
<td class="alt-1">{$introbody}</td>
</tr>
{$tbclose}
{/if}


Add AFTER:
Code:
{if $nag eq '1'}
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";
$tbopen="<table width=\"100%\" class=\"t_outer\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td>\n<table width=\"100%\" class=\"t_inner\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>";
$tbclose="</thead>\n</table>\n</td>\n</tr>\n</table>";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
{/php}
{/if}



In templates/default/cfrm_cat_only.tpl Find:
Code:
{if $introtitle}
{$tbopen}
<tr>
<td class="tdheader">{$introtitle}</td>
</tr>
<tr>
<td class="alt-1">{$introbody}</td>
</tr>
{$tbclose}
{/if}


Add AFTER:
Code:
{if $nag eq '1'}
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";
$tbopen="<table width=\"100%\" class=\"t_outer\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td>\n<table width=\"100%\" class=\"t_inner\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>";
$tbclose="</thead>\n</table>\n</td>\n</tr>\n</table>";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
{/php}
{/if}



In scripts/postlist.inc.php Find:
Code:
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars


Add AFTER:
Code:
	if($userob->check_access("site","SHOW_NAG")) {
		$nag = 1;
	}


Find:
Code:
		"catrow" => $catrow,


Add AFTER:
Code:
		"nag" => & $nag,



In templates/default/postlist.tpl Find:
Code:
{if $intro_title}
{$tbopen}
<tr>
<td class="tdheader">
{$intro_title}
</td>
</tr>
<tr>
<td class="alt-1">
{$intro_body}
</td>
</tr>
{$tbclose}
{/if}


Add AFTER:
Code:
{if $nag eq '1'}
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";
$tbopen="<table width=\"100%\" class=\"t_outer\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td>\n<table width=\"100%\" class=\"t_inner\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>";
$tbclose="</thead>\n</table>\n</td>\n</tr>\n</table>";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
{/php}
{/if}



In scripts/showflat.inc.php Find:
Code:
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars


Add AFTER:
Code:
	if($userob->check_access("site","SHOW_NAG")) {
		$nag = 1;
	}


Find:
Code:
		"newtopic" => $newtopic,


Add AFTER:
Code:
		"nag" => & $nag,



In templates/default/showflat.tpl Find:
Code:
{$pageprint1}


Add ABOVE:
Code:
{if $nag eq '1'}
{php}
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";
$tbopen="<table width=\"100%\" class=\"t_outer\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td>\n<table width=\"100%\" class=\"t_inner\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>";
$tbclose="</thead>\n</table>\n</td>\n</tr>\n</table>";
include("/home/undergroundnews/public_html/forum/languages/english/portal_islands.php");
include("/home/undergroundnews/public_html/forum/languages/english/generic.php");
include("/home/undergroundnews/public_html/forum/cache/portal_box_10.php");
{/php}
{/if}
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318165 - 08/24/09 10:13 AM Re: [7.x] UBB.Nag Screens [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
haven't had a chance to give this a shot yet, hopefully tonight.

Top
#318465 - 02/02/10 09:29 PM Re: [7.x] UBB.Nag Screens [Re: badfrog]
Jersey Joe Offline
Lurker

Registered: 10/05/09
Posts: 7
Gizmo,

I had this working and it was great for announcements and such but I recently moved the site to a new host. I did a test more last week and it came over fine. Did the move tonight and it stopped working. Everything else seems fine as far as we can tell. Any ideas?

Thanks,
Joe

Top
#318469 - 02/02/10 09:46 PM Re: [7.x] UBB.Nag Screens [Re: Jersey Joe]
Gizmo Online   shocked

Wizard

Registered: 01/10/00
Posts: 5287
Loc: Portland, OR, USA
Be sure that you updated the path of the island; if you moved it would have changed.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318470 - 02/02/10 10:16 PM Re: [7.x] UBB.Nag Screens [Re: Gizmo]
Jersey Joe Offline
Lurker

Registered: 10/05/09
Posts: 7
K, think I got it all fixed. Thanks for the quick response. Now seems like WI is now down again....great.


Edited by Jersey Joe (02/02/10 10:17 PM)

Top


Moderator:  sirdude 
Who's Online
1 registered (Gizmo), 29 Guests and 5 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Ubb - Buy It!
best forum software
Latest Posts
I want to create a Self Search mod [Question]
by lightningrod
03/10/10 09:04 PM
If I create a new script, can I just upload it?
by lightningrod
03/10/10 05:35 PM
Notepad Creates Errors when working with PHP
by lightningrod
03/10/10 05:01 PM
Question on Adding a New Script ?
by lightningrod
03/10/10 06:39 AM
Disable Watch List option
by Mike_Tabat
03/09/10 01:27 PM
[7.x] [Pre-7.3] [Final] pJIRC Addon v0.5
by Gizmo
02/27/10 05:07 PM
How to Be a Great Host
by pinku
02/19/10 02:47 AM
New Mods
Disable Watch List option
by Mike_Tabat
02/18/10 09:14 AM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
[7.x] [Pre-7.3] [Final] pJIRC Addon v0.5
by
07/30/06 10:42 PM
Newest Members
joshuasm02, Chosen, Vick, Bartman, Infinity Master
13496 Registered Users
Top Posters
AllenAyres 25554
JoshPet 11330
Rick 8373
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438
(Views)Popular Topics
Known public proxy servers 1028046
Finished-[6.5.2] Games Arcade Deluxe v1.9 327222
Integrated Index Page (IIP) 5.3.1 279924
Integrated Index Page (IIP) 5.1.1 279403
TLD Bv2.1 Released - Threads Links Directory 270427
[6.0x] Who's Online 4.0.0 [Finished] 230365
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 217518
[6.3.x] [beta] Hit Hack 2.0 179339
FlashChat & UBB.threads 161010
[7.x] Gizmo's Embedding BBCode (Pre UBB.T7.3) 154650
Forum Stats
13496 Members
59 Forums
37114 Topics
290378 Posts

Max Online: 686 @ 06/28/07 07:04 AM
Featured Member
Registered: 04/19/09
Posts: 4

 

 

 
fusionbb message board php hacks